import Vue from 'vue'
import Router from 'vue-router'

// import login from '../view/login'
// import index from '../view/index'

// import shopManage from '../view/content/shop_manage'
// import specSetting from '../view/content/spec_setting'
// import orderManage from '../view/content/order_manage'
// import userManage from '../view/content/user_manage'

// 信息管理
// import msgManage from '../view/content/msg_manage'
//捐赠项目管理
// import donateManage from '../view/content/donate_manage'
// import donateItemManage from '../view/content/donateItem_manage'
// import itemfeedback from '../view/content/itemfeedback'
// 会员管理
// import vipManage from '../view/content/vip_manage'
// 客户反馈信息
// import feedbackManage from '../view/content/feedback_manage'
//捐赠品管理
// import donationManage from '../view/content/donation_manage'

Vue.use(Router)

export default new Router({
    routes: [
        {
            path: '/',
            redirect: { name: 'login' },
        },
        {
            path: '/login',
            name: 'login',
            // component: login
            component:resolve => require(['../view/login'],resolve)  
        },
        {
            path: '/index',
            name: 'index',
            // component: index,
            component:resolve => require(['../view/index'],resolve), 
            redirect: { name: 'msg_manage' },
            children: [
                {
                    path: '/index/msg_manage',
                    name: 'msg_manage',
                    // component: msgManage,
                    component:resolve => require(['../view/content/msg_manage'],resolve),
                },
                {
                    path: '/index/donate_manage',
                    name: 'donate_manage',
                    // component: donateManage,
                    component:resolve => require(['../view/content/donate_manage'],resolve),
                    redirect: { name: 'donateItem_manage' },
                    children: [
                        {
                            path: '/index/donate_manage/item',
                            name: 'donateItem_manage',
                            // component: donateItemManage,
                            component:resolve => require(['../view/content/donateItem_manage'],resolve),
                        },
                        {
                            path: '/index/donate_manage/:id',
                            name: 'itemfeedback',
                            // component: itemfeedback,
                            component:resolve => require(['../view/content/itemfeedback'],resolve),
                        }
                    ]
                },
                {
                    path: '/index/vip_manage',
                    name: 'vip_manage',
                    // component: vipManage,
                    component:resolve => require(['../view/content/vip_manage'],resolve),
                },
                {
                    path: '/index/feedback_manage',
                    name: 'feedback_manage',
                    // component: feedbackManage,
                    component:resolve => require(['../view/content/feedback_manage'],resolve),
                },
                {
                    path: '/index/donation_manage',
                    name: 'donation_manage',
                    // component: donationManage,
                    component:resolve => require(['../view/content/donation_manage'],resolve),
                },
                {
                    path: '/index/order_manage',
                    name: 'order_manage',
                    // component: donationManage,
                    component:resolve => require(['../view/content/order_manage'],resolve),
                },
            ]
        }
    ]
})
